﻿<local:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="ComicViewer.Settings"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ComicViewer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">Settings</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="CloseFlyout" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource SettingBkButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource SnappedPageHeaderTextStyle}"/>
        </Grid>

        <Grid Grid.Row="1" Margin="20,0">
            <ScrollViewer>
                <StackPanel>
                    <StackPanel Margin="0,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="24" ToolTipService.ToolTip="Effective only on Bookview mode">RightToLeft :</TextBlock>
                            <CheckBox Margin="5,0" x:Name="chkRightToLeft"  />
                        </StackPanel>
                    </StackPanel>

                    <StackPanel Margin="0,10">
                        <TextBlock FontSize="16" Margin="130,0">*Exprimental</TextBlock>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="24" ToolTipService.ToolTip="Single and Book View will respond to page flip gesture">FlipView :</TextBlock>
                            <CheckBox Margin="5,0" x:Name="chkFlipView"  />
                        </StackPanel>
                    </StackPanel>

                    <StackPanel Margin="0,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock ToolTipService.ToolTip="Effective only on Scroll View Mode" FontSize="24">Zoom Step :</TextBlock>
                            <TextBox x:Name="txtZoomStep" Margin="5,0" TextChanged="txtZoomStep_TextChanged"></TextBox>
                        </StackPanel>
                    </StackPanel>

                    <StackPanel Margin="0,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="24" ToolTipService.ToolTip="Affects Default Comic Open View" >Default View :</TextBlock>
                            <ComboBox x:Name="comboView" SelectedIndex="0" Margin="5,0">
                                <ComboBoxItem>Page View</ComboBoxItem>
                                <ComboBoxItem>Scroll View</ComboBoxItem>
                                <ComboBoxItem>Book View</ComboBoxItem>
                            </ComboBox>
                        </StackPanel>
                    </StackPanel>

                    <StackPanel Margin="0,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="24" ToolTipService.ToolTip="Affects Default Comic Open View" >Page Flip Style:</TextBlock>
                            <ComboBox x:Name="comboMouseFlipType" SelectedIndex="0" Margin="5,0">
                                <ComboBoxItem>Single Click / Tap</ComboBoxItem>
                                <ComboBoxItem>Double Click / Tap</ComboBoxItem>
                            </ComboBox>
                        </StackPanel>
                    </StackPanel>


                    <!--<StackPanel Margin="0,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="24" ToolTipService.ToolTip="Effective only on After Application Restart" >Auto Rotation :</TextBlock>
                            <ComboBox x:Name="comboAutoRotation" SelectedIndex="2" Margin="5,0">
                                <ComboBoxItem>Off</ComboBoxItem>
                                <ComboBoxItem>On</ComboBoxItem>
                                <ComboBoxItem>Prefer LandScape</ComboBoxItem>
                                <ComboBoxItem>Prefer Portrait</ComboBoxItem>
                            </ComboBox>
                            <TextBlock FontSize="20" Foreground="Red" Margin="5,0">*</TextBlock>
                        </StackPanel>
                    </StackPanel>-->

                    <!--<StackPanel Margin="0,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock ToolTipService.ToolTip="specify number of pages, setting 0 disables caching" FontSize="24">Cache Pages :</TextBlock>
                            <TextBox x:Name="txtCachePages" Margin="5,0" TextChanged="txtCachePages_TextChanged"></TextBox>
                        </StackPanel>
                    </StackPanel>-->

                    <StackPanel Orientation="Horizontal">
                        <TextBlock FontSize="20" FontStyle="Italic">*Restart Required</TextBlock>
                    </StackPanel>
                    <StackPanel Margin="0,10" Orientation="Horizontal">
                        <Button x:Name="bttnReset" FontFamily="Global User Interface" FontSize="24" Margin="10,10"  Click="bttnResetAll_Click">Reset</Button>
                        <Button x:Name="bttnApply" FontFamily="Global User Interface" FontSize="24" Margin="10,10" Click="bttnApply_Click">Apply</Button>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </Grid>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>
                <VisualState x:Name="FullScreenPortrait"/>
                <VisualState x:Name="Snapped"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</local:LayoutAwarePage>
